GDK W32: fix monitor pruning code
authorРуслан Ижбулатов <lrn1986@gmail.com>
Thu, 23 Nov 2017 07:15:28 +0000 (07:15 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Sat, 2 Dec 2017 10:38:29 +0000 (10:38 +0000)
Decrement the counter for each removed element, otherwise we skip
one element every time we remove one. Also, no need for continue here.

gdk/win32/gdkmonitor-win32.c

index 56b4a843eb8a796ff3bb6c7b12a9510aa2e8dfb2..2f7afd3a74a00ff66acbf4614e1cfb0a0c1c856f 100644 (file)
@@ -766,10 +766,7 @@ prune_monitors (EnumMonitorData *data)
       m = g_ptr_array_index (data->monitors, i);
 
       if (m->remove)
-        {
-          g_ptr_array_remove_index (data->monitors, i);
-          continue;
-        }
+        g_ptr_array_remove_index (data->monitors, i--);
     }
 }